import {
  Button,
  Card,
  Row,
  Col,
  Tag,
  Form,
  Input,
  ConfigProvider,
  Select,
  DatePicker,
  Dropdown,
  Menu,
  Divider,
  Badge,
  BackTop,
  Carousel,
  Checkbox,
  Tabs,
  Tooltip,
  Steps,
  Modal,
  Avatar,
  Empty,
  Skeleton,
  Alert,
  Radio,
  Pagination,
  Upload,
  Table,
  Timeline,
  Slider,
  InputNumber,
  Space,
  AutoComplete,
  Spin,
  TreeSelect,
  Rate,
  Progress,
  Popconfirm,
  Layout,
  Breadcrumb,
  Collapse,
  List,
  Result,
} from 'ant-design-vue';

import { App } from 'vue';

/**
 * @description 手动注册 antd-vue 组件,达到按需加载目的
 * @description Automatically register components under Button, such as Button.Group
 * @param {ReturnType<typeof createApp>} app 整个应用的实例
 * @returns void
 */
export default function loadComponent(app: App) {
  [
    Button,
    Card,
    Row,
    Col,
    Tag,
    Form,
    Input,
    ConfigProvider,
    Select,
    DatePicker,
    Dropdown,
    Menu,
    Divider,
    Badge,
    BackTop,
    Carousel,
    Checkbox,
    Tabs,
    Tooltip,
    Steps,
    Modal,
    Avatar,
    Empty,
    Skeleton,
    Alert,
    Radio,
    Pagination,
    Upload,
    Table,
    Timeline,
    Slider,
    InputNumber,
    Space,
    AutoComplete,
    Spin,
    TreeSelect,
    Rate,
    Progress,
    Popconfirm,
    Layout,
    Breadcrumb,
    Collapse,
    List,
    Result,
  ].forEach(comp => app.use(comp));
}
